There are twenty
Ranges are often used with If or Select expressions. The following example computes student letter grades based on their test scores. Scores greater than or equal to 90 receive an "A", scores from 80 to 90, not including 90, receive a "B" and so on.
//Compute student letter grades Select {Student.Test Scores} Case UpFrom 90 : "A" Case 80 To_ 90 : "B" Case 70 To_ 80 : "C" Case 60 To_ 70 : "D" Default : "F";
The above example uses the Select expression which is discussed in more detail in the control structures section. You can check if a value is in a range by using the In operator. For example:
5 In 2 To 10; //True 5 In 2 To_ 5; //False 5 In 2 To 5; //True
The Maximum and Minimum functions can be used to find the endpoints of a range:
Maximum (2 To 10) //Returns 10
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |